package com.sky.context;

public class BaseContext {

    /*ThreadLocal 线程隔离  线程内数据共享  线程外数据封闭 */
    public static ThreadLocal<Long> threadLocal = new ThreadLocal<>();

    public static void setCurrentId(Long id) {
        threadLocal.set(id);
    }

    public static Long getCurrentId() {
        return threadLocal.get();
    }

    public static void removeCurrentId() {
        threadLocal.remove();
    }

}
